package by.grsu.pereverzev.page;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.Link;

import by.grsu.pereverzev.entity.Passenger;
import by.grsu.pereverzev.entity.Flight;

public class PereverzevWebPage extends WebPage {

	public PereverzevWebPage() {
		super();
		
		//passengers
		add(new Link("passengerListPage") {
			@Override
			public void onClick() {
				setResponsePage(new PassengersListPage());
			}
		});
		
		add(new Link("passengerCreatePage") {
			@Override
			public void onClick() {
				Passenger newPassenger= new Passenger();
				newPassenger.setName("enter your name");
				setResponsePage(new PassengerEditPage(newPassenger));
			}
		});
		
		//trains
		add(new Link("createFlight") {
			@Override
			public void onClick() {
				setResponsePage(new FlightEditPage(new Flight()));
			}
		});
		add(new Link("findFlights") {
			@Override
			public void onClick() {
				setResponsePage(new FlightFindPage());
			}
		});
		add(new Link("listFlights") {
			@Override
			public void onClick() {
				setResponsePage(new FlightListPage());
			}
		});
		
	}
}
